package com.project.demo.controller;

import com.project.demo.entity.Book;
import com.project.demo.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Corgile
 * @date 2022-02-17
 */
@RestController
public class HelloController {
	@Autowired
	private Book book;
	@Autowired
	private User user;

	@GetMapping(value = "/hello", produces = "application/json;charset=utf-8")
	public String sayHello() {
		System.out.println(this.book);
		System.out.println(this.user);
		return this.book.toString() + ", " + this.user.toString();
	}
}